﻿@{
	ViewBag.Title = "激活您的账号";
	Layout = "~/Views/Shared/_Layout.cshtml";
}
@section LocationPath{
	<a class="title" href="/" >Devtext.com</a> » 激活账号
}
<div id="floatlayout_login" class="blr">
	<h2>激活您的账号</h2>
	<p>
		<label>
			激活码：</label>@Html.Password("txtCode", "", new { @class = "text-input w200" })</p>
	<input type="button" value="激活" onclick="ActiveUser();" class="pn" />
</div>
<script type="text/javascript">
	function ActiveUser() {
		var result = false;
		if ($.trim($("#txtCode").val()).length !=32) {
			alert("请输入有效的激活码");
			return false;
		}

		$.ajax({
			type: "POST",
			url: "/site/activeuser",
			data: "code=" + $.trim($("#txtCode").val()),
			async: false,
			success: function (data) {
				if (data == true) {
					alert("激活成功，转到登录页面登录");
					location.replace("/site/login");
				}
				else {
					alert("激活失败");
				}
			}

		});
		return result;
	}
</script>
